package com.fahai.web.vo;

import com.fahai.utils.DateUtil;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Transient;
import java.sql.Timestamp;

/**
 * Created by WangKe on 17/5/17.
 */
@Data
public class UserInfoListVo {
    @Id
    private Integer userid;

    private Integer proid;

    private String ugcode;

    private String wxopenid;

    private String uname;

    public String getUname() {
        return uname == null ? "" : uname;
    }

    private String userpy;

    private String userpig;

    private String uphone;

    public String getUphone() {
        return uphone == null ? "" : uphone;
    }

    private String uphoneArea;

    public String getUphoneArea() {
        return uphoneArea == null ? "" : uphoneArea;
    }

    private Integer utype;

    private Integer urmoney;

    private Integer lawyerid;

    private String laids;

    private Integer isconf;

    private Integer ustates;
    public String ustatesStr;

    public String getUstatesStr() {
        if (null == ustates) {
            return "未知";
        }
        switch (ustates) {
            case 1:
                return "正常";
            default:
                return "冻结";
        }

    }

    private Integer isvalid;

    private Integer atimes;

    public Integer getAtimes() {
        return atimes == null ? 0 : atimes;
    }

    private Timestamp firstTime;

    private Timestamp lastTime;

    private Timestamp createTime;

    public String getCreateTime() {
        if (null != this.createTime) {
            return DateUtil.TimeStampToString(this.createTime, "yyyy-MM-dd HH:mm:ss");
        } else {
            return "";
        }
    }

    private Timestamp updateTime;

    private Timestamp registerTime;

    public String getRegisterTime() {
        if (null != this.registerTime) {
            return DateUtil.TimeStampToString(this.registerTime, "yyyy-MM-dd HH:mm:ss");
        } else {
            return "";
        }
    }

    public String getUpdateTime() {
        if (null != this.updateTime) {
            return DateUtil.TimeStampToString(this.updateTime, "yyyy-MM-dd HH:mm:ss");
        } else {
            return "";
        }
    }

    public String getFirstTime() {
        if (null != this.firstTime) {
            return DateUtil.TimeStampToString(this.firstTime, "yyyy-MM-dd HH:mm:ss");
        } else {
            return "";
        }
    }

    public String getLastTime() {
        if (null != this.lastTime) {
            return DateUtil.TimeStampToString(this.lastTime, "yyyy-MM-dd HH:mm:ss");
        } else {
            return "";
        }
    }

    private String remark;
    private String bak;

    private String bak1;

    private String bak2;
    private String pxzd;
    private String pxfx;

    @Transient
    private String lawyername;

    public String getLawyername() {
        return lawyername == null ? "" : lawyername;
    }


    //创建时间
    public String createTimeStr() {
        return DateUtil.TimeStampToString(this.createTime, "yyyy-MM-dd HH:mm:ss");
    }

    //首次咨询时间
    public String firstTimetr() {
        return DateUtil.TimeStampToString(this.firstTime, "yyyy-MM-dd HH:mm:ss");
    }

    //末次咨询时间
    public String lastTimeStr() {
        return DateUtil.TimeStampToString(this.lastTime, "yyyy-MM-dd HH:mm:ss");
    }


}
